(function($) { "use strict" jQuery(document).ready(function() { // Initiate superfish on nav menu $('.nav-menu').superfish({ animation: { opacity: 'show' }, speed: 400 }); // Mobile Navigation if ($('#nav-menu-container').length) { var $mobile_nav = $('#nav-menu-container').clone().prop({ id: 'mobile-nav' }); $mobile_nav.find('> ul').attr({ 'class': '', 'id': '' }); $('body').append($mobile_nav); $('body').prepend(''); $('body').append('
'); $('#mobile-nav').find('.menu-has-children').prepend(''); $(document).on('click', '.menu-has-children i', function(e) { $(this).next().toggleClass('menu-item-active'); $(this).nextAll('ul').eq(0).slideToggle(); $(this).toggleClass("lnr-chevron-up lnr-chevron-down"); }); $(document).on('click', '#mobile-nav-toggle', function(e) { $('body').toggleClass('mobile-nav-active'); $('#mobile-nav-toggle i').toggleClass('lnr-cross lnr-menu'); $('#mobile-body-overly').toggle(); }); $(document).click(function(e) { var container = $("#mobile-nav, #mobile-nav-toggle"); if (!container.is(e.target) && container.has(e.target).length === 0) { if ($('body').hasClass('mobile-nav-active')) { $('body').removeClass('mobile-nav-active'); $('#mobile-nav-toggle i').toggleClass('lnr-cross lnr-menu'); $('#mobile-body-overly').fadeOut(); } } }); } else if ($("#mobile-nav, #mobile-nav-toggle").length) { $("#mobile-nav, #mobile-nav-toggle").hide(); } // Smooth scroll for the menu and links with .scrollto classes $('.nav-menu a, #mobile-nav a, .scrollto').on('click', function() { if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname) { var target = $(this.hash); if (target.length) { var top_space = 0; if ($('#header').length) { top_space = $('#header').outerHeight(); if( ! $('#header').hasClass('header-fixed') ) { top_space = top_space; } } $('html, body').animate({ scrollTop: target.offset().top - top_space }, 1500, 'easeInOutExpo'); if ($(this).parents('.nav-menu').length) { $('.nav-menu .menu-active').removeClass('menu-active'); $(this).closest('li').addClass('menu-active'); } if ($('body').hasClass('mobile-nav-active')) { $('body').removeClass('mobile-nav-active'); $('#mobile-nav-toggle i').toggleClass('lnr-times lnr-bars'); $('#mobile-body-overly').fadeOut(); } return false; } } }); $(document).ready(function() { $('html, body').hide(); if (window.location.hash) { setTimeout(function() { $('html, body').scrollTop(0).show(); $('html, body').animate({ scrollTop: $(window.location.hash).offset().top }, 1000) }, 0); } else { $('html, body').show(); } }); // Header scroll class $(window).scroll(function() { if ($(this).scrollTop() > 100) { $('#header').addClass('header-scrolled'); } else { $('#header').removeClass('header-scrolled'); } }); // Department Slider $('.department-slider').owlCarousel({ loop: true, margin: 10, autoplay: true, autoplayTimeout: 2000, autoplayHoverPause: true, nav: false, dots: true, smartSpeed: 1000, responsiveClass: true, responsive: { 0: { items: 1 }, 576: { items: 1 }, 768: { items: 2 }, 992: { items: 3 } } }); // Date Picker jQuery('#datepicker').datetimepicker({ timepicker:false, format:'d.m.Y', }); // // Nice Select $('select').niceSelect(); // Google Map if ( $('#mapBox').length ){ var $lat = $('#mapBox').data('lat'); var $lon = $('#mapBox').data('lon'); var $zoom = $('#mapBox').data('zoom'); var $marker = $('#mapBox').data('marker'); var $info = $('#mapBox').data('info'); var $markerLat = $('#mapBox').data('mlat'); var $markerLon = $('#mapBox').data('mlon'); var map = new GMaps({ el: '#mapBox', lat: $lat, lng: $lon, scrollwheel: false, scaleControl: true, streetViewControl: false, panControl: true, disableDoubleClickZoom: true, mapTypeControl: false, zoom: $zoom, styles: [ { "featureType": "water", "elementType": "geometry.fill", "stylers": [ { "color": "#dcdfe6" } ] }, { "featureType": "transit", "stylers": [ { "color": "#808080" }, { "visibility": "off" } ] }, { "featureType": "road.highway", "elementType": "geometry.stroke", "stylers": [ { "visibility": "on" }, { "color": "#dcdfe6" } ] }, { "featureType": "road.highway", "elementType": "geometry.fill", "stylers": [ { "color": "#ffffff" } ] }, { "featureType": "road.local", "elementType": "geometry.fill", "stylers": [ { "visibility": "on" }, { "color": "#ffffff" }, { "weight": 1.8 } ] }, { "featureType": "road.local", "elementType": "geometry.stroke", "stylers": [ { "color": "#d7d7d7" } ] }, { "featureType": "poi", "elementType": "geometry.fill", "stylers": [ { "visibility": "on" }, { "color": "#ebebeb" } ] }, { "featureType": "administrative", "elementType": "geometry", "stylers": [ { "color": "#a7a7a7" } ] }, { "featureType": "road.arterial", "elementType": "geometry.fill", "stylers": [ { "color": "#ffffff" } ] }, { "featureType": "road.arterial", "elementType": "geometry.fill", "stylers": [ { "color": "#ffffff" } ] }, { "featureType": "landscape", "elementType": "geometry.fill", "stylers": [ { "visibility": "on" }, { "color": "#efefef" } ] }, { "featureType": "road", "elementType": "labels.text.fill", "stylers": [ { "color": "#696969" } ] }, { "featureType": "administrative", "elementType": "labels.text.fill", "stylers": [ { "visibility": "on" }, { "color": "#737373" } ] }, { "featureType": "poi", "elementType": "labels.icon", "stylers": [ { "visibility": "off" } ] }, { "featureType": "poi", "elementType": "labels", "stylers": [ { "visibility": "off" } ] }, { "featureType": "road.arterial", "elementType": "geometry.stroke", "stylers": [ { "color": "#d6d6d6" } ] }, { "featureType": "road", "elementType": "labels.icon", "stylers": [ { "visibility": "off" } ] }, {}, { "featureType": "poi", "elementType": "geometry.fill", "stylers": [ { "color": "#dadada" } ] } ] }); } }); jQuery(window).on('load', function() { // WOW JS new WOW().init(); // Preloader $('.preloader').fadeOut(500); }); })(jQuery);